home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Assassins - Ultimate CD Games Collection 4
/
Assassins 4 (1999)(Weird Science).iso
/
docs
/
board-games
/
progammon2.7.doc
< prev
next >
Wrap
Text File
|
1992-09-02
|
25KB
|
574 lines
ProGammon
Version 2.7
9th July 1998
FREEWARE
The Ultimate Amiga Backgammon Game
Introduction:
Have you tried playing computer backgammon before? Were you a little
disappointed at the poor game play?
Most users will find that this program plays a very challenging game
of backgammon. No matter what level you play at, your game will
improve by playing ProGammon.
This program will keep track of your wins and losses so you can see how
good you or the Amiga really is. It now also keeps track of gammons and
backgammons.
It's operating system friendly and is very cpu & memory efficient so your
3-D rendering work will barely slow down while you play a game or 3. :)
Requirements:
This program should work on any Amiga with kickstart 2.04 or greater.
With an AGA Amiga, this game will use a 640 x 480 multiscan productivity
screen, if available. It also works in 640 x 256 PAL mode or 640 x 200
NTSC mode..
One user also informed me that it works great on his Picasso II+ graphics
board in his A1200T. Thanks Dirk!
What's New:
Version 2.7:
-added a tool type called TRAINER. This allows the user to
ask ProGammon to suggest a move anytime during gameplay. A
second opinion is useful, even if you don't agree with it!
-finally, a PAL tool type so the program will now work in
640 x 256 hi-res PAL if needed.
-the last release introduced a major change in game play. This
version merely contains some minor adjustments.
-added a new section on interpreting the winning percentage.
If you like mathematics then check it out.
Version 2.6:
-complete rewrite of the AI to encourage more blocking and
maintaining of key positions. Thanks Phillip !
-added a NAME tool type and a CHEAT tool type so you can use
your own dice if you don't like the computer generated ones.
-also added a DONE tool type. See the Tool Type section.
-click on the dice after you complete a game and the Amiga
winning percentage will now be displayed.
Version 2.5:
-improved the AI used during the late stages of the game. It
should be much harder to gammon the Amiga.
-added some code to encourage the Amiga to maintain a wall of
6 stones once it has established one.
-cleaned up various routines for speed and size.
Version 2.4:
-added an Undo function so you can start your move over again if
you need to.
-fixed a bug in v2.3 where occasionally the program would prevent
you from making a valid move.
-removed the debug_hunks which significantly reduced the size of
the program.
Thanks to Nils Goers for all of the above suggestions and improvements.
-finally got around to putting the documentation in AmigaGuide
format.
The Basics:
The game begins with the following board setup:
******************************************** Direction of
* 24 23 22 21 20 19 18 17 16 15 14 13 * Movement:
* v v v v v v v v v v v v *
* X O O X * --->
* X O O X *
* O O X * |
* O X * |
* O X * |
* * V
* 3 5 *
* * |
* X O * |
* X O * |
* X X O * V
* O X X O *
* O X X O * <---
* ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ *
* 1 2 3 4 5 6 7 8 9 10 11 12 *
********************************************
^ ^ ^ ^ ^ ^
Your HOME area is positions 1 to 6.
There are 24 positions on the board and each player begins with 15 stones.
'X' represents your stones and the 'O' represents the Amiga's stones. In
the diagram above you have 2 stones on position 24, 3 stones on position
8 and 5 stones each on positions 6 and 13. The 3 and the 5 in the center
of the board represent the dice.
Each player takes turns rolling the dice and moving their stones an amount
equal to whatever was rolled.
The object of the game is to move your stones in a clockwise direction
into your home area. When all 15 stones are home you can remove them from
the board depending on what you roll. The first player who removes all of
their stones from the board wins the game.
The game starts with each player rolling one die to determine which player
gets to go first. For example, if the Amiga rolled a 3 and you rolled a
5 then you would start by using this combination for your first move.
Here is one possibility:
********************************************
* 24 23 22 21 20 19 18 17 16 15 14 13 *
* v v v v v v v v v v v v *
MOVE 1--> X X O O X *
* O O X *
Using the 3 * O O X *
* O X *
* O <---MOVE 2
* *
* _ _ * Using the 5
* *
* X O *
* X X O *
* X X O *
* O X X O *
* O X X O *
* ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ *
* 1 2 3 4 5 6 7 8 9 10 11 12 *
********************************************
^
With the 3 I moved one stone from position 24 to position 21. For the
second move I moved a stone from position 13 to position 8. After the
opening move each player alternates rolling the dice.
Either player can move to any position as long as it is not blocked by 2
or more of the opposing players stones. In the above example I would not
have been allowed to use the 5 to move a stone from position 24 to
position 19 because the Amiga has position 19 blocked.
It is possible to move to a position that has only 1 Amiga stone on it.
When this happens, your stone will take possesion of that point and the
Amiga stone will be knocked off onto the center bar. Any stone on the
bar has to enter the board in the opposing players home area. You must
get back on the board, on a point that is not blocked, before any further
moves are allowed. If you cannot make a move just click once on the dice
to give up your turn and resume play.
When all of your stones are home, you can start removing them from the
board. This is called bearing off. If, for example, you rolled a 6 and
a 2, you could remove one stone from position 6 and another one from
position 2. If you rolled a 6 but didn't have any stones on position 6
to remove then you are allowed to take one stone off the next highest
position. It is also legal to move stones within your home area rather
than bearing them off. It might be an advantage to do this if the Amiga
still has some stones in your home area and is trying to knock you off
onto the bar.
The only other rule is that both players must use as much of what they
rolled as possible. If you rolled a 5 and a 3 and it is possible to use
both the 5 and the 3 then you must make both moves. If you can only use
the 5 or the 3 but not both then you are required to use the higher
amount(5). The Amiga plays by these rules and now, since version 2.3,
you are forced to play by these rules also.
Game Play:
To move a stone just click once on the stone and then once on the spot
where you want it to go. If you did it right then the stone should move
to the new location or else a message will appear to help you out.
If you roll doubles ( i.e. two 3's ) then instead of getting two moves
of 3 you get four moves of 3.
Anytime during a move you can get an update to how many moves you have
left by clicking anywhere outside the main board area. In the message
area will be displayed the dice values that have not yet been used.
You can also make multiple moves. If, for example, you roll a 3 and
a 4 then you are allowed to make one move of 7 as long as both points
between your present location and your destination are not blocked.
If you are unable to make a move then just click once on the dice to
continue with the game. If you select a stone by mistake then just click
on that same stone to start your move over again.
Once all your stones are in your home area, you can remove them from the
board by double clicking on them.
A gammon will be declared if one player is able to get all his stones off
before the other player has removed one. This is equivalent to winning 2
games.
A backgammon occurs when one player gammons the other player plus he traps
at least one of the opposing players stones in his home area. This is
worth 3 wins.
Menus:
BAR
With this option all 15 stones will start off on the center bar. You
will have to get all the stones back on the board before you can start
to move them. Just select BAR in the menus and then select New Game
to play this version.
Undo Move
You can restart your move from the beginning by selecting this from the
menus. You could also accomplish the same thing by clicking on the
stone and putting it back wherever it came from.
Colors
Selecting this will allow you to adjust both the board colors as well
as the speed of the game.
If you select SAVE in the color adjustment window then your game
preferences will be saved to a 266 byte file called gammon.prefs in
the current directory. The program keeps track of the AMIGA's winning
percentage in this file as well as statistics on the dice. If you want
this feature then remember to click on SAVE before the end of the
first game.
Stats
This menu item will display a table of what you have rolled so far as
well as what your average roll has been. A long term average roll of
8.167 is ideal.
Statistics on wins/gammons/backgammons are now also displayed within
this window.
Clicking on the left side of the stats window will show the statistics
for the present series of games and clicking on the right side will show
the overall statistics for all games that have been played, including
previous games stored in the gammon.prefs file.
Tool Types:
MAINFONT=topaz
FONTSIZE=8
These 2 tool types allow you to use any reasonably sized font for your
menus, message display and window title in VGA mode. If the program is
unable to find this font or if your size choice is too large then it will
use topaz 8 as the default.
REVERSE
I prefer setting up the board so that you move your stones from the
upper left part of the screen to the lower left in a clockwise direction.
If you would prefer that the board was set up so that your stones move
from the upper right part of the board to the lower right in a counter-
clockwise direction then use this tool type.
NTSC
This tool will force the program to use a 640x200 NTSC screen or dblNTSC
screen if available.
PAL
As above except this one causes ProGammon to use a 640x256 PAL screen.
NAME=Kevin
Replace Kevin with your name and then you won't have to be called Human
anymore.
CHEAT
This tooltype simply lets you use your own dice. Click on the dice in
one of 6 quadrants and you will see what I mean.
If you would like to be able to create an external dice file and then have
this program read in dice values from there then let me know.
DONE
With this tool type you will have to click on the dice after each move to
signal to the Amiga that you are done. Some users like to be able to see
how a move looks before having to commit themselves to it. No more
accidental moves.
TRAINER
Use this tool type to improve your game. Click anywhere on the lower part
of the board and the Amiga will suggest a move for you. For example, if
the opening roll was ( 2 - 3 ) then the Amiga might display this:
13/11 13/10
This means move one stone from your 13 point to your 11 point and move
another stone from your 13 point to your 10 point. The points are
numbered from 1 to 24 with 24 being the farthest point away from your home
area. See The Basics for further board numbering information.
A display of Bar/23 means move a stone from the Bar to point 23 and
5/0 suggests that you should bear a stone off from the 5 point.
If you are having trouble winning, then learning to play like ProGammon
does is a good first step. As you improve, you should start to see moves
that are even better than the ones that PG suggests.
Winning should now be easy, or at least, easier!
GLENSKI
Finally, the GLENSKI tool type. One user likes to be able to select a
New Game from the keyboard using "Right Amiga N". You can also have this
feature by using this tool type.
Testing the Dice:
The dice used in this program have been rolled millions of times in order
to test them for randomness and fairness. They are produced using the
SAS/C random number generating function called drand48(). In testing, I
have found the numbers returned by this function to be 100% random.
Here are some answers to the usual questions that I have received:
There is only one subroutine that controls the rolling of the dice. The
RollDice() routine has no idea whether it is being called to roll the
dice for you or for the Amiga. It does not check to see who is on the bar
or what points are blocked or whether it's the start of the game or the
end. All it does is just roll the dice.
The Amiga is not cheating just because it rolls a 6 to start the game or
rolls doubles to end the game. It has gotten lucky and if you play enough
games I'm sure that you will get lucky too.
Every roll of the dice will be saved in the gammon.prefs file after you
select Quit in the menus or close the game screen. During the game you
can select Stats in the menus to see the averages for the games that you
are presently playing. By clicking on the right portion of the statistics
screen you can also examine the stats saved in the gammon.prefs file.
After you play about 250+ games, you should be convinced that the dice are
100% legal.
If you still think that this game is cheating then you can use the CHEAT
tooltype which will allow you to enter your own dice values. Play a few
games with a real set of dice and you will probably find that this program
still plays a pretty good game of backgammon.
If you would like to use your own random number generating routines with
this program then let me know and I'll see what I can do.
Math Facts:
This section is optional but if your background in mathematics is fairly
strong then you may find what follows very interesting.
Let's say there are 2 computer backgammon players that are completely
equal. They use the exact same algorithm. In the long run, they will both
win 50% of the games that they play against each other.
Now, you know from playing ProGammon that in a short set of games you can
be either a hero or a bum! Recently, I went 1 Win and 9 Losses during a
set of 10 games. At other times, I have gone 9 Wins and 1 Loss.
The point I'm trying to make is that you can't judge a player or a game
over a small set of games. A 10 game set neither proves that a player
or program is stupid or brilliant. There is a lot of luck involved in a
game of backgammon. This is why you have to play a large number of games
before the winning percentage starts to have some real meaning.
So, the question is, how many games is enough? Is 100 games enough, or
300, or 500, or perhaps even 900? I have played a couple of 300 game
sets and by then the average dice rolls for both players have been near
the 8.167 mark. I used to think that at this point the winning percentage
would start to have some real meaning.
Guess what? Mathematically, or scientifically speaking, this number
really doesn't mean as much as you might think.
Even after playing 500 games, 2 completely equal players can have their
winning percentage vary between 0.400 and 0.600. Most of the time they
are going to win about 250 games each because they are equally skilled.
However, one player may get extremely lucky over a 500 game set and end
up winning 300 games and the other player only 200. Believe it or not,
this can happen even though they are completely equal.
I've included a computer generated chart to help explain this further.
The implications are kind of interesting.
The amount of variation quoted above is between 2 players that play
consistent backgammon. They never get tired and they never learn from
their mistakes. The moves they make never change or evolve.
People, on the other hand, as they learn are constantly changing how they
play backgammon. They find a particular style of play that seems to work
over 100 games and they stick to it. What doesn't work is abandoned.
There is so much variation in a game of backgammon, that coming to any
conclusions concerning what works and what doesn't is often times wrong!
The amount of variation increases when you add in the fact that people
get tired and the decisions they make concerning when to run, when to
hit, etc., etc. are constantly changing.
Have a look at the following chart:
W I N % N U M B E R O F G A M E S P E R S E T
100 300 500 900
0.300 -> 1 0 0 0
0.310 -> 0 0 0 0
0.320 -> 1 0 0 0
0.330 -> 6 0 0 0
0.340 -> 5 0 0 0
0.350 -> 10 0 0 0
0.360 -> 12 0 0 0
0.370 -> 26 0 0 0
0.380 -> 40 1 0 0
0.390 -> 68 0 0 0
0.400 -> 107 2 0 0
0.410 -> 138 18 1 0
0.420 -> 243 25 3 0
0.430 -> 293 83 11 0
0.440 -> 399 162 51 8
0.450 -> 463 302 141 35
0.460 -> 555 515 355 149
0.470 -> 704 811 751 482
0.480 -> 738 1085 1184 1135
0.490 -> 781 1331 1593 1999
0.500 -> 824 1363 1809 2384
0.510 -> 785 1261 1649 1926
0.520 -> 735 1080 1132 1158
0.530 -> 676 805 756 542
0.540 -> 589 577 335 149
0.550 -> 472 305 150 28
0.560 -> 390 162 63 5
0.570 -> 297 72 8 0
0.580 -> 214 25 6 0
0.590 -> 163 8 1 0
0.600 -> 102 3 1 0
0.610 -> 62 4 0 0
0.620 -> 41 0 0 0
0.630 -> 26 0 0 0
0.640 -> 14 0 0 0
0.650 -> 10 0 0 0
0.660 -> 6 0 0 0
0.670 -> 2 0 0 0
0.680 -> 1 0 0 0
0.690 -> 1 0 0 0
0.700 -> 0 0 0 0
Ok now, what do all these numbers really mean??
I wrote a program to simulate 2 Amigas playing backgammon against each
other. They are both using the same algorithm and are both as equal as
can be.
The first column is the winning percentage just like what is displayed
in ProGammon.
The second through fifth columns represent sets of games that they played
against each other. The two Amigas were always fighting about who was the
better backgammon player so they started by playing sets of 100 games.
At the end of each set of 100 games, Player A would see what his winning
percentage was and then he would add 1 to the appropriate row.
The first time they got together to determine a champion they played
10,000 sets of 100 games each. (i.e. 10,000 x 100 = 1,000,000 games)
If you look at the table you will see that they played dead even at
( 0.500 ) 824 out of the 10,000 sets they played ( 8.24% of the time ).
If you look up at the 0.350 level you will see that on 10 occasions
Amiga A had a winning percentage of only 0.350 after a 100 game set.
These two players are totally equal but because of the luck of the dice,
look how poorly Amiga A did on 10 different occasions.
There was also 13 other times when his winning percentage was worse. On
those occasions Amiga A only won between 0.300 and 0.340 of the time.
What this proves is that if you play 100 games and you think the winning
percentage is telling you whether you're a good player or ProGammon is a
good program is nonsense. You can't come to any conclusions whatsoever.
On one occasion Player A won only 30 of 100 games and at the other extreme
one time Player A won 69 out of 100 games. This large variation isn't
because Player A or B were playing tremendously or lousy. They were
always playing equally intelligently. The variation is due solely to
the randomness of the dice.
If you look at the other columns you will see that there is still a lot
of variation even when they sat down and played 300 game sets, 500 game
sets and finally they played a 900 game set 10,000 times.
Even after playing a 900 game set of backgammon, the winning percentage
varied between 0.440 and 0.560. If your winning percentage is 0.560
after playing 900 games, you have not proven that you are clearly
superior.
Though unlikely, it is still possible that you were just lucky. It is
possible that you could play another 900 game set and the Amiga could
come out on top.
Try to give the above some thought before declaring yourself an expert
backgammon player after winning 10 games in a row.
Acknowledgments:
Thanks very much to the 11 people that took the time to register.
Special thanks to Nils Goers who showed me the correct way to compile a
program.
Many, many thanks to Phillip A. Cochran who showed me how backgammon is
supposed to be played. Hopefully this version will be a little more
challenging!
I'd also like to thank Glenski and Claire Shannon for their ideas. It's
good to know that some people appreciate a good game of backgammon.
Glenski has contributed many ideas including the latest PAL version.
His eX wife Claire also helped with the TRAINER feature. Thanks to
both of you for all your help testing this program.
Without the encouragement of the registered users, this program would not
have reached it's current level.
Freeware:
You will be hard pressed to find a significantly better playing computer
backgammon game. This time, I mean it!
Questions, comments and bug reports are always welcome.
Long live the AMIGA!
Mail:
Kevin Glynn
2844 B - 42nd Street S.W.
Calgary, AB T3E 3M1
CANADA
e-mail:
glynnk@cadvision.com